---@class SkillLimitType
SkillLimitType = ClientFight.CreateClass("SkillLimitType")
local map = {}
function SkillLimitType:ctor(id,name)
    self.id = id
    self.name = name.."["..id.."]"
end
function SkillLimitType:valueOf(id)
    return map[id]
end
---@return SkillLimitType
local function ADD_VALUE(type,id,name)
    local e = SkillLimitType.New(id,name)
    map[e.id] = e
    SkillLimitType[type] = e
    return e
end
---@param fighter Fighter
---@param skillTemplate T_skillBean
function SkillLimitType:action( fighter, skillTemplate)
    local skillLimit = skillTemplate.f_SkillLimit;
    if (skillLimit ~= nil) then
        for k,params in pairs(skillLimit) do
            if (not self:valueOf(params[1]):actionImp(fighter, skillTemplate, params)) then
                return false
            end
        end
    end
    return true;
end
function SkillLimitType:actionImp(fighter,skillTemplate,params)
end

local t = ADD_VALUE("type1",1,"限制召唤物上线")
---@param fighter Fighter
---@param skillTemplate T_skillBean
---@param params number[]
function t:actionImp(fighter, skillTemplate, params)
    local summonId = params[2];
    local summonCount = params[3];

    local count = 0;
    local fighters = fighter.fightTeam.fighters
    for k, f in pairs( fighters) do
        local continue = false
        if (f.summonsCreater == nil or f.summonsCreater ~= fighter) then
            continue = true
        end
        if (f.summonId ~= summonId) then
            continue = true
        end
        if not continue then
            count = count + 1
        end
    end

    return count < summonCount;
end
